<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加管理员</title>
    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/Theme1/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/style.min.css?v=4.1.0" rel="stylesheet">

    <link href="__PUBLIC__/Theme1/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">

    <link href="__PUBLIC__/Theme1/css/newstyle.css" rel="stylesheet">

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>添加管理员 <a href="__URL__/managelists" style="margin-left: 15px; color: #06cbc4">管理员列表</a></h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form method="post" action="__URL__/ManageAddAction" class="form-horizontal" id="form-admin-add" >
                            <div class="form-group">
                                <label class="col-sm-2 control-label">登陆账号</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"  placeholder="2到15个字符" value="<{$rs_admin.aUser}>" name="aUser" id="aUser">
                                </div>
                            </div>
                            
                                <div class="form-group">
                                <label class="col-sm-2 control-label">真实姓名</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" value="<{$rs_admin.aName}>" placeholder="2到5个字符" id="aName" name="aName">
                                    </div>
                            	</div>

                                <div class="form-group">
                                <label class="col-sm-2 control-label">密码</label>
                                    <div class="col-sm-10">
                                        <input type="password" class="form-control" autocomplete="off" value="" placeholder="6-16位" id="aPwd" name="aPwd">
                                    </div>
                                </div>

                                <div class="form-group">
                                <label class="col-sm-2 control-label">确认密码</label>
                                    <div class="col-sm-10">
                                        <input type="password" class="form-control" autocomplete="off" value="" placeholder="6到16位字符" id="aPwd2" name="aPwd2">
                                    </div>
                                </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">性别</label>
                                <div class="col-sm-10">
                                    <label class="checkbox-inline">
                                        <input type="radio" value="1" name="aSex" checked> 男</label>
                                    <label class="checkbox-inline">
                                        <input type="radio" value="2" name="aSex"> 女</label>
                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">管理地区</label>
                                <div class="col-sm-7" >
                                    <select class="selectRegione"  name="regione1" >
                                        <option value="0">请选择</option>
                                        <foreach name="regiones" item="valregione" key="regionek">
                                            <option value="<{$valregione.id}>" ><{$valregione.name}></option>
                                        </foreach>
                                    </select>
                                    <select class="selectRegione"  name="regione2" style="display: none"><option value="0">请选择</option></select>
                                    <select class="selectRegione"  name="regione3" style="display: none" ><option value="0">请选择</option></select>
                                    <select class="selectRegione"  name="regione4" style="display: none" ><option value="0">请选择</option></select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">管理权限</label>
                                <div class="col-sm-7" >
                                    <select class="selectRegione"  name="aPowers" >
                                        <option value="1">本级管理员</option>
                                        <option value="2">操作管理员</option>
                                    </select>
                                </div>
                            </div>
                                
                                
                                <div class="form-group">
                                <label class="col-sm-2 control-label">手机</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" placeholder="" id="aTel" name="aTel">
                                    </div>
                                </div>
                                

                                <div class="form-group">
                                <label class="col-sm-2 control-label">邮箱</label>
                                    <div class="col-sm-10">
                                    <input type="email" class="form-control" placeholder="@" name="aEmail" id="aEmail">
                                    </div>
                                </div>

                            
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-primary" type="submit">保存</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="__PUBLIC__/Theme1/js/jquery.min.js?v=2.1.4"></script>
    <script src="__PUBLIC__/Theme1/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="__PUBLIC__/Theme1/js/content.min.js?v=1.0.0"></script>
    <script src="__PUBLIC__/Theme1/js/plugins/iCheck/icheck.min.js"></script>

<script type="text/javascript" src="__PUBLIC__/Theme1/check/js/jquery.validate.min.js"></script> 

<script type="text/javascript" src="__PUBLIC__/Theme1/check/js/messages_zh.min.js"></script> 

<script type="text/javascript" src="__PUBLIC__/Theme1/check/js/validate-methods.js"></script> 

    <script>
        $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
    </script>
    
    <script type="text/javascript">
    $(function(){
    $("#form-admin-add").validate({
        rules:{
            aUser:{
                required:true,
                minlength:4,
                maxlength:16
            },
            aName:{
                required:true,
                minlength:2,
                maxlength:14
            },
            aPwd:{
                required:true,
                minlength:6,
                maxlength:16
            },
            aPwd2:{
                required:true,
                equalTo: "#aPwd"
            },
            aSex:{
                required:true,
            },
            aTel:{
                required:true,
                isPhone:true,
            },
            aPowers:{
                required:true,
            },
            
        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
        submitHandler:function(form){
            $(form).ajaxSubmit();
            var index = parent.layer.getFrameIndex(window.name);
            parent.$('.btn-refresh').click();
            parent.layer.close(index);
        }
    });
});
</script>

    <SCRIPT type="text/javascript">
        $(function(){

            //当第一个选择时，给第二填充数据
            $("[name='regione1']").change(function(){
                $("[name='regione2']").html('<option value="0">加载中...</option>');
                var id=$(this).val();
                var html='<option value="0">请选择</option>';
                $.ajax({    //ajax方法获取选定区域的下级区域列表
                    url:"/Personnelsystem/Department/getChildId",
                    data:{id:id},
                    dataType:'json',
                    type:'post',
                    success:function(re){
                        var html='<option value="0">请选择</option>';
                        var item=re;
                        for(var i in item){
                            html +='<option value="'+item[i]['id']+'" >'+item[i]['name']+'</option>';
                        }
                        $("[name='regione2']").html(html);
                        $("[name='regione2']").show();
                    }
                })
            });
            //当第2个选择时，给第3填充数据
            $("[name='regione2']").change(function(){
                $("[name='regione3']").html('<option value="0">加载中...</option>');
                var id=$(this).val();
                var html='<option value="0">请选择</option>';
                $.ajax({    //ajax方法获取选定区域的下级区域列表
                    url:"/Personnelsystem/Department/getChildId",
                    data:{id:id},
                    dataType:'json',
                    type:'post',
                    success:function(re){
                        var html='<option value="0">请选择</option>';
                        var item=re;
                        for(var i in item){
                            html +='<option value="'+item[i]['id']+'" >'+item[i]['name']+'</option>';
                        }
                        $("[name='regione3']").html(html);
                        $("[name='regione3']").show();
                    }
                })
            });
            //当第3个选择时，给第4填充数据
            $("[name='regione3']").change(function(){
                $("[name='regione4']").html('<option value="0">加载中...</option>');
                var id=$(this).val();
                var html='<option value="0">请选择</option>';
                $.ajax({    //ajax方法获取选定区域的下级区域列表
                    url:"/Personnelsystem/Department/getChildId",
                    data:{id:id},
                    dataType:'json',
                    type:'post',
                    success:function(re){
                        var html='<option value="0">请选择</option>';
                        var item=re;
                        for(var i in item){
                            html +='<option value="'+item[i]['id']+'" >'+item[i]['name']+'</option>';
                        }
                        $("[name='regione4']").html(html);
                        $("[name='regione4']").show();
                    }
                })
            });

        })

    </SCRIPT>
</body>

</html>
